package com.artpri.action.user;

import java.util.List;
import java.util.Map;

import com.artpri.action.BaseAction;
import com.artpri.model.AdPicture;
import com.artpri.model.vo.OrderInfoVo;
import com.artpri.model.vo.RecGoods;
import com.artpri.model.vo.SimpleGoods;
import com.artpri.service.AdPictureService.ImageState;
import com.artpri.service.OrderInfoService.OrderType;

/**
 * 个人中心 
 * @author ZhangSi
 */
public class SelfCenterAction extends BaseAction {

	private static final long serialVersionUID = 7498539582187496026L;

	private List<OrderInfoVo> myorder;
	
	private List<SimpleGoods> mycollect;
	
	private String userName;
	private String userPic;
	
	private List<Integer> orderNum;
	
	private Map<String, AdPicture> vipRecMap;
	
	private Map<String, RecGoods> recWorkMap;
	
	private Map<String, List<SimpleGoods>> buyWhatMap;
	
	@Override
	public String execute() throws Exception {
		//1.我的订单
		myorder = getOrderInfoService().listOrderVoByPage(getSessionUser().getUserNum(), OrderType.UNFINISH, 1, 3);
		//2.我的收藏
		mycollect = getAttentionCenterService().listGoodsCollectByPage(getSessionUser().getUserNum(), 1, 4);
		//3.个人信息
		userName = getSessionUser().getUserName();
		userPic = getSessionUser().getUserPicture();
		//4.订单数量
		orderNum = getOrderInfoService().countOrder(getSessionUser().getUserNum());
		//5.买什么
		buyWhatMap = getAdPictureService().getBuyWhatMapByPlate("00202", ImageState.SHOW, 5);
		//6.会员推荐
		vipRecMap = getAdPictureService().getAdPictureMapByPlate("00201", ImageState.SHOW);
		//7.推荐作品
		recWorkMap = getAdPictureService().getRecWorkMapByPlate("00203", ImageState.SHOW);
		return SUCCESS;
	}

	public List<OrderInfoVo> getMyorder() {
		return myorder;
	}

	public void setMyorder(List<OrderInfoVo> myorder) {
		this.myorder = myorder;
	}

	public List<SimpleGoods> getMycollect() {
		return mycollect;
	}

	public void setMycollect(List<SimpleGoods> mycollect) {
		this.mycollect = mycollect;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public List<Integer> getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(List<Integer> orderNum) {
		this.orderNum = orderNum;
	}

	public String getUserPic() {
		return userPic;
	}

	public void setUserPic(String userPic) {
		this.userPic = userPic;
	}

	public Map<String, RecGoods> getRecWorkMap() {
		return recWorkMap;
	}

	public void setRecWorkMap(Map<String, RecGoods> recWorkMap) {
		this.recWorkMap = recWorkMap;
	}

	public Map<String, List<SimpleGoods>> getBuyWhatMap() {
		return buyWhatMap;
	}

	public void setBuyWhatMap(Map<String, List<SimpleGoods>> buyWhatMap) {
		this.buyWhatMap = buyWhatMap;
	}

	public Map<String, AdPicture> getVipRecMap() {
		return vipRecMap;
	}

	public void setVipRecMap(Map<String, AdPicture> vipRecMap) {
		this.vipRecMap = vipRecMap;
	}
}
